﻿using System;

using JetBrains.Application;
using JetBrains.ComponentModel;
using JetBrains.ReSharper.Daemon;

namespace FinlogiK.ReSharperContrib
{
	/// <summary>
	/// 	Highlighting integration component for FinlogiK contrib.
	/// </summary>
	[ShellComponentImplementation(ProgramConfigurations.ALL)]
	public sealed class HighlightingRegistry : IShellComponent
	{
		#region Constructors

		/// <summary>
		/// 	Initializes a new instance of the <see cref = "HighlightingRegistry" /> class.
		/// </summary>
		public HighlightingRegistry()
		{
		}

		#endregion

		#region IShellComponent Members

		/// <summary>
		/// 	Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
		/// </summary>
		public void Dispose()
		{
		}

		/// <summary>
		/// 	<para>Initializes the component. Called by the component container after the component is created.</para>
		/// 	<para><see cref = "M:System.IDisposable.Dispose" /> is the pairing method that's guaranteed to be called by the component container to tear down your component.</para>
		/// 	<para>You must not access other components before your <see cref = "M:JetBrains.ComponentModel.IComponent.Init" /> method is called.</para>
		/// 	<para>All of the components that you access from <see cref = "M:JetBrains.ComponentModel.IComponent.Init" /> are guaranteed to exist when your <see cref = "M:System.IDisposable.Dispose" /> is called. Any other component might be missing by that time, and trying to get it will throw an exception.</para>
		/// </summary>
		public void Init()
		{
			HighlightingSettingsManager manager = HighlightingSettingsManager.Instance;
			manager.RegisterConfigurableSeverity("MissingStaticQualifier", "FinlogiK Contrib", 
				"Add static qualifier", "A static qualifier (i.e. 'ClassName.') can be added before a reference to a static member.", Severity.SUGGESTION);
		}

		#endregion
	}
}